package com.color.controller;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.context.request.WebRequest;

import com.color.service.IUserNoService;

@Controller
public class UserNoCtrl {
	
	@Autowired
	@Qualifier("userNoService")
	private IUserNoService userNoService;
	
	
	@ResponseBody
	@RequestMapping(value="/color/getUser.htm",method = {RequestMethod.GET,RequestMethod.POST})
	public Map<String, Object> getPageList(ModelMap model,WebRequest request){
 		return userNoService.getPageList(model,request);
	}
	
	@RequestMapping(value="/color/getUserPage.htm",method = {RequestMethod.GET,RequestMethod.POST})
	public String getMain(){
		return "color/userno";
	}
	
	@ResponseBody
	@RequestMapping(value="/color/commitUser.htm",method = {RequestMethod.GET,RequestMethod.POST})
	public Map<String,Object> commitData(ModelMap model,WebRequest request){
		return userNoService.commitData(request);
	}
	
	@RequestMapping(value="/color/getUserColorPage.htm",method = {RequestMethod.GET,RequestMethod.POST})
	public String getColor(ModelMap model){
		userNoService.getMaxUserNo(model);
		return "color/opencolorno";
	}
	
	@ResponseBody
	@RequestMapping(value="/color/getUserColor.htm",method = {RequestMethod.GET,RequestMethod.POST})
	public Map<String, Object> getColorPageList(ModelMap model,WebRequest request){
 		return userNoService.getPageList(model,request);
	}
	
	@ResponseBody
	@RequestMapping(value="/color/oprUserColor.htm",method = {RequestMethod.GET,RequestMethod.POST})
	public Map<String, Object> oprUserColor(ModelMap model,WebRequest request){
 		return userNoService.oprUserColor(request);
	}
}
